package com.atguigu.yygh.hosp.controller;

import com.atguigu.yygh.hosp.service.DepartmentService;
import com.atguigu.yygh.result.R;
import com.atguigu.yygh.vo.hosp.DepartmentVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@Api(tags = "医院科室接口")
@RequestMapping("/admin/hosp/department")
public class DepartmentController {

    @Autowired
    DepartmentService departmentService;

    //查看医院科室 格局医院编号查询所有的科室
    @ApiOperation(value = "查看医院科室")
    @GetMapping("getDeptList/{hoscode}")
    public R getDeptList(@PathVariable String hoscode){
         List<DepartmentVo>  departmentList = departmentService.getDeptList(hoscode);
        return  R.ok().data("departmentList",departmentList) ;
    }
}
